<template>
    <view class="container data-v-473e52e8">
        <view class="header-tabs data-v-473e52e8">
            <view @tap="__e" :class="['tab-item', 'data-v-473e52e8', current == 0 ? 'active' : '']" :data-current="0" :data-event-opts="[['tap', [['e0', ['$event']]]]]">
                <text class="text data-v-473e52e8">抽奖码</text>
                <view class="tab-item-num data-v-473e52e8">{{ ticketTotal }}</view>
            </view>
            <view @tap="__e" :class="['tab-item', 'data-v-473e52e8', current == 1 ? 'active' : '']" :data-current="1" :data-event-opts="[['tap', [['e1', ['$event']]]]]">
                <text class="text data-v-473e52e8">已中奖</text>
                <view class="tab-item-num data-v-473e52e8">{{ luckyTicketTotal }}</view>
            </view>
            <view @tap="__e" :class="['tab-item', 'data-v-473e52e8', current == 2 ? 'active' : '']" :data-current="2" :data-event-opts="[['tap', [['e2', ['$event']]]]]">
                <text class="text data-v-473e52e8">助力记录</text>
                <view class="tab-item-num data-v-473e52e8">{{ inviteeTotal }}</view>
            </view>
        </view>
        <view class="swiper-wrapper data-v-473e52e8">
            <swiper @change="__e" class="data-v-473e52e8" :current="current" :data-event-opts="[['change', [['swiperChange', ['$event']]]]]">
                <swiper-item class="data-v-473e52e8">
                    <scroll-view @scrolltolower="__e" class="data-v-473e52e8" :data-event-opts="[['scrolltolower', [['scrolltolower', ['$event']]]]]" :scrollY="true">
                        <ticket-item
                            @__l="__l($event, { eventOpts: [['^refresh', [['initData']]]] })"
                            @refresh="__e($event, { eventOpts: [['^refresh', [['initData']]]] })"
                            class="data-v-473e52e8"
                            :data-event-opts="[['^refresh', [['initData']]]]"
                            :info="item"
                            :vueId="'be4fb052-1-' + index"
                            v-for="(item, index) in ticketList"
                            :key="index"
                        ></ticket-item>
                        <no-data @__l="__l" class="data-v-473e52e8" title="暂无抽奖码记录" vueId="be4fb052-2" v-if="!$root.g0"></no-data>
                    </scroll-view>
                </swiper-item>
                <swiper-item class="data-v-473e52e8">
                    <scroll-view @scrolltolower="__e" class="data-v-473e52e8" :data-event-opts="[['scrolltolower', [['scrolltolower', ['$event']]]]]" :scrollY="true">
                        <ticket-item
                            @__l="__l($event, { eventOpts: [['^refresh', [['initData']]]] })"
                            @refresh="__e($event, { eventOpts: [['^refresh', [['initData']]]] })"
                            class="data-v-473e52e8"
                            :data-event-opts="[['^refresh', [['initData']]]]"
                            :info="item"
                            :vueId="'be4fb052-3-' + index"
                            v-for="(item, index) in luckyTicketList"
                            :key="index"
                        ></ticket-item>
                        <no-data @__l="__l" class="data-v-473e52e8" title="暂无已中奖记录" vueId="be4fb052-4" v-if="!$root.g1"></no-data>
                    </scroll-view>
                </swiper-item>
                <swiper-item class="data-v-473e52e8">
                    <scroll-view @scrolltolower="__e" class="data-v-473e52e8" :data-event-opts="[['scrolltolower', [['scrolltolower', ['$event']]]]]" :scrollY="true">
                        <invitee-item
                            @__l="__l"
                            class="data-v-473e52e8"
                            :info="item"
                            :vueId="'be4fb052-5-' + index"
                            v-for="(item, index) in inviteeList"
                            :key="index"
                        ></invitee-item>
                        <no-data @__l="__l" class="data-v-473e52e8" title="暂无助力记录" vueId="be4fb052-6" v-if="!$root.g2"></no-data>
                    </scroll-view>
                </swiper-item>
            </swiper>
        </view>
    </view>
</template>

<script>
import noData from '@/components/NoData/NoData';
import ticketItem from '@/pages/lotteryTicket/components/TicketItem';
import inviteeItem from '@/pages/lotteryTicket/components/InviteeItem';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['pages/lotteryTicket/index'],
    {
        3198: function (t, e, n) {},
        '3e4f': function (t, e, n) {
            'use strict';

            var i = n('3198');
            n.n(i).a;
        },
        '486b': function (t, e, n) {
            'use strict';

            (function (t, e) {
                var i = n('4ea4');
                n('18ba');
                i(n('66fd'));
                var c = i(n('eff0'));
                t.__webpack_require_UNI_MP_PLUGIN__ = n;
                e(c.default);
            }.call(this, n('bc2e').default, n('543d').createPage));
        },
        '556f': function (t, e, n) {
            'use strict';

            n.d(e, 'b', function () {
                return c;
            });
            n.d(e, 'c', function () {
                return a;
            });
            n.d(e, 'a', function () {
                return i;
            });
            var i = {
                NoData: function () {
                    return n.e('components/NoData/NoData').then(n.bind(null, 'cafe'));
                }
            };
            var c = function () {
                var that = this;
                var e = (that.$createElement, that._self._c, that.ticketList.length);
                var n = that.luckyTicketList.length;
                var i = that.inviteeList.length;
                that._isMounted ||
                    ((that.e0 = function (e) {
                        that.current = 0;
                    }),
                    (that.e1 = function (e) {
                        that.current = 1;
                    }),
                    (that.e2 = function (e) {
                        that.current = 2;
                    }));
                that.$mp.data = Object.assign(
                    {},
                    {
                        $root: {
                            g0: e,
                            g1: n,
                            g2: i
                        }
                    }
                );
            };
            var a = [];
        },
        5754: function (t, e, n) {
            'use strict';

            n.r(e);
            var i = n('e992');
            var c = n.n(i);
            for (var a in i) {
                if (['default'].indexOf(a) < 0) {
                    (function (t) {
                        n.d(e, t, function () {
                            return i[t];
                        });
                    })(a);
                }
            }
            e.default = c.a;
        },
        e992: function (t, e, n) {
            'use strict';

            (function (t) {
                var i = n('4ea4');
                Object.defineProperty(e, '__esModule', {
                    value: true
                });
                e.default = void 0;
                var c = i(n('2eee'));
                var a = i(n('c973'));
                var u = {
                    components: {
                        TicketItem: function () {
                            n.e('pages/lotteryTicket/components/TicketItem')
                                .then(
                                    function () {
                                        return resolve(n('a7dc'));
                                    }.bind(null, n)
                                )
                                .catch(n.oe);
                        },
                        InviteeItem: function () {
                            n.e('pages/lotteryTicket/components/InviteeItem')
                                .then(
                                    function () {
                                        return resolve(n('ac4f'));
                                    }.bind(null, n)
                                )
                                .catch(n.oe);
                        }
                    },
                    data: function () {
                        return {
                            uuid: '',
                            current: 0,
                            inviteeList: [],
                            ticketList: [],
                            luckyTicketList: [],
                            ticketTotal: 0,
                            luckyTicketTotal: 0,
                            inviteeTotal: 0
                        };
                    },
                    computed: {},
                    onLoad: function (t) {
                        var that = this;
                        return (0, a.default)(
                            c.default.mark(function n() {
                                return c.default.wrap(function (n) {
                                    for (;;) {
                                        switch ((n.prev = n.next)) {
                                            case 0:
                                                that.current = t.actived || 0;
                                                that.uuid = t.uuid;
                                            case 2:
                                            case 'end':
                                                return n.stop();
                                        }
                                    }
                                }, n);
                            })
                        )();
                    },
                    onShow: function () {
                        t.showLoading({
                            title: '加载中'
                        });
                        this.initData();
                    },
                    methods: {
                        initData: function () {
                            var that = this;
                            this.$http('/lotteries/'.concat(this.uuid, '/my-invitees'), 'GET', {
                                per_page: 200
                            }).then(function (n) {
                                that.inviteeList = n.data.list;
                                that.inviteeTotal = n.data.item_total;
                                t.hideLoading();
                            });
                            this.$http('/lotteries/'.concat(this.uuid, '/my-tickets'), 'GET', {
                                per_page: 50,
                                is_lucky: 1
                            }).then(function (t) {
                                that.luckyTicketList = t.data.list;
                                that.luckyTicketTotal = t.data.item_total;
                            });
                            this.$http('/lotteries/'.concat(this.uuid, '/my-tickets'), 'GET', {
                                per_page: 500
                            }).then(function (t) {
                                that.ticketList = t.data.list;
                                that.ticketTotal = t.data.item_total;
                            });
                        },
                        swiperChange: function (t) {
                            var e = t.detail.current;
                            this.current = e;
                        },
                        scrolltolower: function () {}
                    }
                };
                e.default = u;
            }.call(this, n('543d').default));
        },
        eff0: function (t, e, n) {
            'use strict';

            n.r(e);
            var i = n('556f');
            var c = n('5754');
            for (var a in c) {
                if (['default'].indexOf(a) < 0) {
                    (function (t) {
                        n.d(e, t, function () {
                            return c[t];
                        });
                    })(a);
                }
            }
            n('f4ff');
            n('3e4f');
            var u = n('f0c5');
            var o = Object(u.a)(c.default, i.b, i.c, false, null, '473e52e8', null, false, i.a, void 0);
            e.default = o.exports;
        },
        f4ff: function (t, e, n) {
            'use strict';

            var i = n('f8b1');
            n.n(i).a;
        },
        f8b1: function (t, e, n) {}
    },
    [['486b', 'common/runtime', 'common/vendor']]
]);
</script>
<style>
@import './index.css';
</style>
